/**
 * Created by Sky on 2016/5/12.
 */
module.exports = function($parse){
    return {
        restrict: 'E',
        template: '<img src="images/wenben.png" class="button" />',
        replace: true,
        link: function($scope, element, attrs, controller) {
            element.bind("click", function(e){
                if($('.demoLorry').css('display')=="none"){
                    $('.demoLorry').css('display',"block");
                }else{
                    $('.demoLorry').css('display',"none");
                }

                $(document).on("click touchstart'", function(){
                    $('.demoLorry').css('display',"none");
                });
                e.stopPropagation();
            });
          /* $(".menu").on("click", function(e){
                e.stopPropagation();
            });*/
            }
    };

};